package org.tissou.client.DonneesAAfficher;

import com.google.gwt.user.client.rpc.IsSerializable;

import java.util.ArrayList;
import java.util.List;

import org.tissou.client.Services.MonException;

/**
 * Created by IntelliJ IDEA.
 * User: Claire
 * Date: 03/03/2009
 * Time: 21:12:32
 * To change this template use File | Settings | File Templates.
 */
public class LigneDonnee implements IsSerializable {
  List<Element> elements = new ArrayList<Element>();
  int nombreColonne = 0;
  TypeDonnee type;

  public LigneDonnee(TypeDonnee t) {
     this.type = t;
   }

  public LigneDonnee() {
  }

  public int getNombreColonne() {
    return nombreColonne;
  }

  public void ajouterElement(Element e) {
    elements.add(e);
    nombreColonne++;
  }

  public Element getElement(int i){
    return elements.get(i);
  }

  public void clear(){
    elements.clear();
  }

  public LigneDonnee clone(){
    LigneDonnee clone = new LigneDonnee();
    for (Element element : elements){
      clone.ajouterElement(element.clone());
    }
    return clone;
  }
}
